function generateRandomColorWithAlpha(Alpha = 0.3) {
    // 生成一个随机的红绿蓝(RGB)颜色值
    const red = Math.floor(Math.random() * 256); // 从00到FF
    const green = Math.floor(Math.random() * 256); // 从00到FF
    const blue = Math.floor(Math.random() * 256); // 从00到FF

    // 将RGB和Alpha值转换为十六进制字符串，并格式化透明度
    const randomColor = `rgba(${red}, ${green}, ${blue}, ${Alpha})`;

    return randomColor;
}

function getOpacityColor(thisColor, thisOpacity) {
    var theColor = thisColor.toLowerCase();
    //十六进制颜色值的正则表达式
    var r = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;
    // 如果是16进制颜色
    if (theColor && r.test(theColor)) {
        if (theColor.length === 4) {
            var sColorNew = '#';
            for (var i = 1; i < 4; i += 1) {
                sColorNew += theColor.slice(i, i + 1).concat(theColor.slice(i, i + 1));
            }
            theColor = sColorNew;
        }
        //处理六位的颜色值
        var sColorChange = [];
        for (var j = 1; j < 7; j += 2) {
            sColorChange.push(parseInt('0x' + theColor.slice(j, j + 2)));
        }
        return 'rgba(' + sColorChange.join(',') + ',' + thisOpacity + ')';
    }
    // 如果是rgba或者rgb
    if (theColor.startsWith('rgb')) {
        let numbers = theColor.match(/(\d(\.\d+)?)+/g);
        numbers = numbers.slice(0, 3).concat(thisOpacity);
        return 'rgba(' + numbers.join(',') + ')';
    }

    return theColor;
}